package com.xzx.server.pojo;


import com.baomidou.mybatisplus.extension.api.R;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;

import java.security.PrivateKey;

@Data
@AllArgsConstructor
@NoArgsConstructor
public class RespBean {
    private Long code;
    private String message;
    private Object obj;

    /**
     * 成功返回结果
     *
     * @param message
     * @return
     */
    public static RespBean success(String message) {
        return new RespBean(200L, message, null);
    }


    /**
     * 成功返回结果
     *
     * @param message
     * @return
     */
    public static RespBean success(String message, Object obj) {
        return new RespBean(200L, message, obj);
    }

    /**
     * 失败返回结果
     *
     * @param message
     * @return
     */
    public static RespBean error(String message) {
        return new RespBean(500L, message, null);
    }

    /**
     * 失败返回结果
     *
     * @param message
     * @return
     */
    public static RespBean error(String message, Object obj) {
        return new RespBean(500L, message, obj);
    }
}

